import subprocess
def getOSName():
    command = "uname";
    osName = execute(command)['stdout'];
    if "" == osName:
        return "Windows"
    else:
        return osName
    
def execute(command):
    returnResult = {'stdout':"", 'stderr': ""}
    try:
        ps = subprocess.Popen(command, stdout=subprocess.PIPE, stderr = subprocess.PIPE)
        returnResult['stdout'] = ps.stdout.read().strip()
        ps.stdout.close()
        returnResult['stderr'] = ps.stderr.read().strip()
        ps.stderr.close()
        ps.wait()
    except Exception, e:
        returnResult['stdout'] = ""
        returnResult['stderr'] = ""
    return returnResult